/*
 * Copyright 2010 Michael Nitsche
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package de.mnit.basis.daten.struktur.container;

import de.mnit.basis.daten.struktur.container.A_Kistenstapel;
import de.mnit.basis.daten.struktur.container.DBKiste;
import de.mnit.basis.daten.struktur.container.S_Kiste;
import de.mnit.basis.daten.struktur.gruppe.Gruppe2;

/**
 * @author Michael Nitsche
 * 10.03.2009	Erstellt
 */
public abstract class A_DBKistenstapel extends A_Kistenstapel {

	/** TODO Jede Klasse muß/sollte eine INFO-Variable implementieren. Irgendwie abstract lösen! **/
//	public static final B_FooBar info = new B_FooBar();


	public String gFehler() {
		for(Gruppe2<String,S_Kiste<?>> s : this.gKisten()) {
			String f=((DBKiste<?>)s.g2()).gFehler();
			if(f!=null)
				return s.g1()+": "+f;
		}
		return null;
	}

	public boolean gGueltig() {
		for(Gruppe2<String,S_Kiste<?>> s : this.gKisten())
			if(!((DBKiste<?>)s.g2()).gGueltig())
				return false;
		return true;
	}

}
